package org.filetransfer.file_transfer_java_backend;

import org.filetransfer.file_transfer_java_backend.repository.FileRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class DatabaseTestRunner implements CommandLineRunner {

    private final FileRepository fileRepository;

    public DatabaseTestRunner(FileRepository fileRepository) {
        this.fileRepository = fileRepository;
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("Total files in database: " + fileRepository.count());
    }
}
